# This file is part of BlackArch Linux ( https://blackarch.org )
# See COPYING for license details.

pkgbase=python-flask-restplus
pkgname=('python2-flask-restplus' 'python-flask-restplus')
_pkgname=flask-restplus
pkgver=0.13.0
pkgrel=7
pkgdesc='Fully featured framework for fast, easy and documented API development with Flask.'
arch=('any')
url='https://pypi.org/project/Flask-restplus/#files'
makedepends=('python2-setuptools' 'python-setuptools')
license=('BSD')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('d44d18af66b7999e3cc6197cc491fac36c4feda39de61155ea1f0bf438ba9a7a8bf89368ac9343313d9399e14876ebd7d169e7e333fb7f7749b9f5e1edb09151')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-flask-restplus() {
  depends=('python2' 'python2-flask' 'python2-aniso8601' 'python2-pytz'
           'python2-six' 'python2-enum34' 'python2-jsonschema')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-flask-restplus() {
  depends=('python' 'python-flask' 'python-aniso8601' 'python-pytz'
           'python-six' 'python-jsonschema')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

